package com.neuedu.corejava.ch10.homework;

import java.util.HashMap;
import java.util.Random;

public class TestBankDepositors {

	public static void main(String[] args) {
		//新建一个hashmap对象
		HashMap<String , BankDepositors> userMap=new HashMap<String , BankDepositors>();
		
		//保存10个信息
		for(int i=0;i<10;i++) {
			userMap.put("user"+i,new BankDepositors("user"+i,"user name"+i,new Random().nextInt(50000)));
			
		}
		//根据储户id，查询余额
		
		String userId="user8";
		BankDepositors user = userMap.get(userId);
		System.out.println(user.getBalance());

	}

}









































